<!-- 用户列表 -->
<script lang="ts">
export default {
  name: "xjyxuserList",
};
</script>
<template>
  <div class="page-box h100 display-flex czbj">
    <p class="title-label mb10">
      用户列表
    </p>
    <div>
      <dxtable   
       :headBtn="headBtn"
       :dataJson="dataJson" 
       :portUrl="portUrl" 
       :qx="qx" 
       sonRouter="xjyxaddUser"
       ref="databale">
      </dxtable>
    </div>

  </div>
</template>
<script lang='ts' setup>
import { rowDark } from "naive-ui/es/legacy-grid/styles";
import dxtable from "../../../components/util/dxtable.vue";
import sort from "../../../components/util/sort.vue";
import { dxget, dxpost, qurl, hf, transferTimeYMDHm } from "../../../util/index";
import { h, ref, reactive, onBeforeUpdate } from "vue";
import videoplay from "../videoplay.vue"
const props = defineProps({
  pup: { type: String },
});
const showModal = ref(false)
const videourl = ref()
let headBtn = [];
const zdList = ref()
const databale = ref();
const typeli = ref([])
const initeer = () => {
  databale.value.initDataExpose();
};
const emit = defineEmits(["callBack"]);
// 弹窗公用该列表
let dataJson = reactive([
  {
    title: "id",
    key: "id",
    width: 50,
  },

  {
    title: "姓名",
    search: true, // 是否在搜索栏展示
    key: "name"
  },
  {
    title: "昵称",
    key: "nickname"
  },
  {
    title: "类型",
    search: true, // 是否在搜索栏展示
    type:"select",
    key:"type",
    options:[{
      label:"全部",
      value:""
    },{
      label:"医生",
      value:1
    },{
      label:"员工",
      value:2
    }],
    render(row) {
      return row.type==1?'医生':'员工'
    }
  },
  {
    title: "员工编码",
    search: true, // 是否在搜索栏展示
    key: "employeeCode"
  }, {
    title: "省份",
    search: true, // 是否在搜索栏展示
    key: "province",
    type:"select",
    options:[],
  },

  {
    title: "医院",
    search: true, // 是否在搜索栏展示
    key: "hospital"
  }, {
    title: "科室",
    search: true, // 是否在搜索栏展示
    key: "administrativeOffice"
  }, {
    title: "职务",
    search: true, // 是否在搜索栏展示
    key: "post",
    type:"select",
    options:[],
  }, {
    title: "手机",
    search: true, // 是否在搜索栏展示
    key: "phone"
  }, 




  // {
  //   title: "排序",
  //   width: 100,
  //   render(row) {
  //     row.databaseName = "xjyxuserList";
  //     return h(sort, {
  //       row,
  //       onCallBack: () => {
  //         initeer();
  //       },
  //     });
  //   },
  // },
  {
    title: "添加时间",
    key: "addTime",
    width: "140",
    type: "daterange",
  },
]);
let portUrl = "xjyx/userList";
const qx = {
  DeletePermissionID: "xjyxuserListdel", //删除
  EditPermissionIdentifier: "xjyxuserListbj", // 编辑
  NewPermissionIdentifier: "xjyxuserListxz", // 新建
  ViewPermissionID: "xjyxuserListck", // 查看
};


const getcasetype = async () => {
    const { data }: any = await dxget("dxgjAdmin/getzd", { name: 'xjdiqu' })
    data.map(a=>{
      a.value= a.label
    })
    dataJson[5].options = [
        {
            label: "全部",
            value: ""
        },
        ...data
    ]
 
    console.log(dataJson[4]);
    // ishjwoer.value = true
}
getcasetype()


const getxjyxzhiwu = async () => {
    const { data }: any = await dxget("dxgjAdmin/getzd", { name: 'xjyxzhiwu' })
    data.map(a=>{
      a.value= a.label
    })
    dataJson[8].options = [
        {
            label: "全部",
            value: ""
        },
        ...data
    ]
}
getxjyxzhiwu()
</script>
  
  
  